package game.buildings;

/**
 *	@(#)Fountain.java
 *
 *	The <code>Fountain</code> class represents the fountain building.
 *	A fountain reduces the pollution of a player by one.
 *	It also reduces the famine level by one when built.
 *
 *	@author Grzegorz Kobiela
 *	@version 1.0 2008/5/13
 */
public final class Fountain
extends CityBuilding
implements Limited
{
	/** The amount of tiles left. */
	private static int tiles;

	/**
 	 *	Creates a new <code>Fountain</code> instance.
	 */
	public Fountain() {
		super(BuildingType.FOUNTAIN);
		polygon = new java.awt.Polygon(new int[]{0, 1, 1, 0}, new int[]{0, 0, 1, 1}, 4);
		spin = 1;
	}

	/**
	 *	Resets the amount of tiles to the initial value.
	 */
	public static void resetTiles() {
		tiles = 16;
	}

	/**
	 *	Decreases the amount of tiles left by the given amount.
	 *	@param n the amount
	 */
	public void decreaseTiles(int n) {
		tiles -= n;
	}

	/**
	 *	Returns the amount of tiles left.
	 *	@return the amount of tiles left
	 */
	public int getTiles() {
		return tiles;
	}
}